namespace SubhadraSolutions.Sharp.Logging.Parsing
{
    using SubhadraSolutions.Sharp.Logging.Contracts;
    using System;
    using System.Globalization;

    [Serializable]
    public class LogRecord : LogStoreItem
    {
        #region Constructors

        public LogRecord(long positionInFile, int serialNumber, LogItemSeverity severity,
            DateTime timeStamp,
            int threadId, string threadName, object logEntry)
        {
            PositionInFile = positionInFile;
            SerialNumber = serialNumber;
            Severity = severity;
            TimeStamp = timeStamp;
            ThreadId = threadId;
            ThreadName = threadName;
            LogEntry = logEntry;
        }

        #endregion Constructors

        #region Properties

        public long PositionInFile
        {
            get;
            private set;
        }

        public int SerialNumber
        {
            get;
            private set;
        }

        #endregion Properties

        #region Methods

        public override string ToString()
        {
            return SerialNumber.ToString(CultureInfo.InvariantCulture) + '\t' + base.ToString();
        }

        #endregion Methods
    }
}